package com.v2coding.player;

import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.tencent.rtmp.TXVodPlayer;
import com.tencent.rtmp.ui.TXCloudVideoView;

public class ReactPlayerManager extends SimpleViewManager<TXCloudVideoView> {

    public static final String REACT_CLASS = "RCTPlayer";
    public static TXVodPlayer player = null;

    @Override
    public String getName() {
        return REACT_CLASS;
    }

    @Override
    protected TXCloudVideoView createViewInstance(ThemedReactContext reactContext) {
        TXCloudVideoView view = new TXCloudVideoView(reactContext);
        player = new TXVodPlayer(reactContext);
        player.setPlayerView(view);
        player.startPlay("http://1251826991.vod2.myqcloud.com/9d437dcbvodgzp1251826991/e09506f57447398155305881369/f0.mp4");
        return view;
    }
}
